package com.mars.algorithm;

import java.time.LocalDate;

/**
 * @Author King
 * @create 2020/6/29 11:47
 */
public class HeapImpl {

    public static void main(String[] args) {
        LocalDate time = LocalDate.of(1960, 1, 1);
        LocalDate time1 = LocalDate.of(2020, 1, 1);
        LocalDate time2 = LocalDate.of(1991, 1, 1);
        LocalDate time3 = LocalDate.of(1990, 1, 1);
        LocalDate time4 = LocalDate.of(2019, 1, 1);
        LocalDate time5 = LocalDate.of(2018, 1, 1);
        LocalDate time6 = LocalDate.of(2017, 1, 1);
        creatAll(time);
        creatAll(time1);
        creatAll(time2);
        creatAll(time3);
        creatAll(time4);
        creatAll(time5);
        creatAll(time6);
    }


    public static void creatAll(LocalDate date) {
        String[] sky = new String[]{"酉", "戌", "亥", "子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申"};
        String[] time = new String[]{"庚", "辛", "壬", "癸", "甲", "乙", "丙", "丁", "戊", "己"};
        int year = date.getYear();
        String t1 = time[year % 10];
        String s1 = sky[year % 12 - 1];
        System.out.println(date.getYear() + "年是:" + t1 + s1);
    }


    public static void sortHeap(int[] arr) {
        if (null == arr || arr.length == 0) {
            return;
        }
        int len = arr.length;
        //构建最大堆
        buildMaxHeap(arr, len);

        for (int i = len - 1; i > 0; i--) {
            //堆顶和堆尾交换
            swap(arr, 0, i);
            len--;
            //重置最大堆
            heap(arr, i, len);
        }
    }

    public static void buildMaxHeap(int[] arr, int len) {

    }

    public static void swap(int[] arr, int i, int j) {

    }

    public static void heap(int[] arr, int i, int len) {

    }


}
